/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control_ingresos_techpro;

import admin_conexion.AdminConexion;
import admin_conexion.ControlDatos;
import java.sql.ResultSet;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;

/**
 *
 * @author Chapas
 */
public class Ingreso_Vehiculos extends javax.swing.JFrame {

    /**
     * Creates new form Ingreso_Vehiculos
     */
    
    String[] acura = {"CL", "NSX", "SLX", "Integra", "RDX", "TL", "Legend", "RL", "TSX", "MDX", "RSX", "ZDX"};
    String[] alfa = {"164"};
    String[] audi = { "90","Allroad","A3","A4","A5","A6","A8","Cabriolet","Q5","Q7","R8","S4","S5","S6","S8","RS 4","TT","TTS"};
    String[] bmw = {"1-Series", "3-Series", "5-Series", "6-Series", "7-Series", "8-Series", "ActiveHybrid" , "ActiveHybrid 7", "Alpina","Roadster V8","M","M6", "X3","M3","X5", "X6","Z3", "Z4", "Z8"};
    String[] cadillac = {"Catera","CTS","CTS-V","Deville","DTS","Eldorado","Escalade","Escalade EXT","Fleetwood","Seville","SRX","STS","STS-V","XLR","XLR-V"};
    String[] chevrolet = {"Astro","Avalanche","Aveo","Aveo5","Beretta","Blazer","C1500","C2500","C3500","Camaro","Caprice","Cavalier","Cobalt","Colorado","Corsica","Corvette","Cruze","Equinox","Express","G1500","G20","G2500","G30","G3500","HHR","Impala","K1500","K2500","K3500","Lumina","Malibu","Metro","Monte Carlo","Prizm","S10","Silverado","SSR","Suburban","T10","Tahoe","Tracker","Trailblazer","Traverse","Uplander","Venture","Volt"};
    String[] chrysler	= {"200","300","300M","Aspen","Cirrus","Concorde","Corssfire","Grand Voyayer","Lebaron","LHS","New Yorker","Pacifica","Prowler","PT Cruiser","Sebring","Town & Country","Voyayer"};	
    String[] land_rover	= {"Defender","Discovery","Discovery Series II","FreeLander","LR2","LR3","LR4","Range Rover","Range Rover Sport"};
    String[]lexus		= {"CT 200h","ES300","ES330","ES350","GS300","GS350","GS400","GS430","GS450H","GS460","GX460","GX470","HS250h","IS250","IS300","IS350","IS-F","LS400","LS430","LS460","LS600H","LX450","LX470","LX570","RX300","RX330","RX350","RX400h","RX450h","SC300","SC400","SC430"};
    String[]lincoln		= {"Aviator","Blackwood","Continental","LS","Mark LT","Mark VIII","MKS","MKT","MKX","MKZ","Navigator","Town Car","Zephyr"};
    String[]mazda		= {"121","323","626","929","B-2300","B-2500","B-3000","B-4000","CX-7","CX-9","Mazda2","Mazda3","Mazda5","Mazda6","Speed3","Speed6","Speed Miata MX-5","Speed Protege","Miata","Miata MX-5","Millenia","MPV","MX-3","MX-6","Protege","Protege5","RX-7","RX-8","Tribute",};
    String[]mercedes_benz 	= {"C","CL","CLK","CLS","E","G","GL","GLK","M","R","S","SL","SLK","SLR Mclaren","SLS AMG","Sprinter"};
    String[]mercury		= {"Cougar","Grand Marquis","Marauder","Mariner","Milan","Montego","Monterey","Mountaineer","Mystique","Sable","Tracer","Village"};
    String[]mini		= {"Cooper","Cooper Contryman","Rover"};
    String[]mitsubishi          = {"3000 GT","Diamante","Eclipse","Eclipse Spyder","Endeavor","Galant","L200","Lancer","Lancer Evolution","Lancer Sportback","Mighty Max","Mirage","Montero","Montero Sport","Outlander","Ounlander Sport","Raider",};
    String[]nissan		= {"200SX","240SX","300ZX","350Z","370Z","Altima","Armada","Cube","Frontier","GT-R","Juke","Leaf","Maxima","Murano","Murano CrossCabriolet","Pathfinder","Pickup","Quest","Roque","Sentra","Titan","Versa","Xterra"};
    String[]daewoo		= {"Lanos","Leganza","Nubira"};
    String[]dodge		= {"Avenger","B150","B1500","B250","B2500","B350","B3500","Caliber","Carayan","Challenger","Charger","Dakota","Durango","Grand Caravan","Intrepid","Journey","MAgnum","Neon","Nitro","RAM 1500","RAM 2500","RAM 3500","RAM Van 1500","RAM Van 2500","RAM Van 3500","Ram Wagon 1500","RAM Wagon 2500","Spirit","Sprinter 2500","Sprinter 3500","SRT-4","Stealth","Stratus" };
    String[]eagle		= {"Summit","Talon","Vision",};
    String[]ferrari		= {"360 Modena","360 Spider","456 GT","456M","458 Italia","550 Maranello","599","612 Scaglietti","California","Enzo","F355 Berlinetta","F430","Superamerica",};
    String[]ford		= {"Aerostar","Aspire","Bronco","Contour","Crown Victoria","E-150","E-250","E-350","Edge","Escape","Escort","Excursion","Expedition","Explorer","Explorer Sport","Explorer Sport Trac","F-150","F-250","F-350","F-450","Fiesta","Five Hundred","Flex","Focus","Freestar","FreeStyle","Fusion","GT","Mustang","Probe","Ranger","Shelby GT500","Taurus","Taurus X","Thunderbird","Transit Connect","Windstar","ZX2"};
    String[]geo                 = {"Metro","Prizm","Tracker",};
    String[]gmc                 = {"Acadia","C1500","C2500","C3500","Canyon","Envoy","Envoy XL","Envoy XUV","G1500","G2500","G3500","Jimmy","K1500","K2500","Safari","Savana","Sierra","Sonoma","Terrain","Yukon","Yukon XL","Yukon XL 1500","Yukon XL 2500","","","","","","","",};
    String[]honda		= {"Accord","Accord Crosstour","Civic","City","CR-V","CR-Z","Del Sol","Element","Fit","Insight","Odyssey","Passport","Pilot","Prelude","Ridgeline","S2000","","","","","",};
    String[]hyundai		= {"Accent","Azera","Elantra","Elantra Touring","Entourage","EON","Equus","Genesis","Genesis Coupe","i10","Santa Fe","Scoupe","Sonata","Sonata Hybrid","Tiburon","Tucson","Veracruz","XG300","XG350","","","","",};
    String[]hummer              = {"H1","H2","H3","H3T"};
    String[]infiniti            = {"EX35","FX35","FX45","FX50","G20","G25","G35","G37","I30","I35","J30","M35","M37","M45","OX4","OX56"};	
    String[]isuzu		= {"Amigo","Ascender","Axiom","BT-50","DMax","Hombre","I-280","I-290","I-350","I-370","Oasis","Rodeo","Rodeo Sport","Trooper","Vehicross"};
    String[]jeep		= {"Cherokee","Commander","Compass","Grand Cherokee","Liberty","Patriot","Wrangler"};
    String[]kia                 = {"Amanti","Borrego","Forte","Optima","Picanto","Rio","Rio5","Sedona","Sephia","Sorento","Soul","Spectra","Spectra5","Sportage"};    
    String[]pontiac		= {"Aztek","Bonneville","Firebird","G3","G5","G6","G8","Grand AM","Grand Prix","GTO","Montana","Solstice","Sunfire","Torrent","Transport","Vibe"};
    String[]scion		= {"TC","XA","XB","XD"};
    String[]smart		= {"ForTwo"};
    String[]subaru		= {"B9 Tribeca","Baja","Forester","Impreza","Legacy","Outback","SVX","Tribeca"};
    String[]suzuki		= {"Aerio","Equator","Esteem","Forenza","Forenza Wagon","Grand Vitara","Kizashi","Reno","Samurai","Sidekick","Swift","SX4","SX4 Crossover","SX4 Sport","SX4 SportBack","Verona","Vitara","X-90","XL7","XL-7",};
    String[]toyota		= {"4Runner","Auris","Avalon","Camry","Camry Solara","Celica","Corolla","Echo","FJ Cruiser","Highlander","Land Cruiser","Matrix","MR2","MR2 Spyder","Paseo","Previa","Prius","RAV4","Sequoia","Sienna","Supra","T-100","Tacoma","Tercel","Tundra","Venza","Yaris"};
    String[]volkswagen          = {"Beetle","Cabriolet","CC","Eos","GLI","Golf","Golf III","GTI","Jetta","Jetta III","New Jetta","New Passat","Passat","R32","Rabbit","Routan","Tiquan","Touaeq","Touareq 2",};	
    String[]volvo		= {"850","940","960","C30","C70","S40","S60","S70","S80","S90","V40","V50","V70","V90","XC60","XC70","XC90"};

            
    
    
    ControlDatos controld = new ControlDatos();
    private AdminConexion aconect = new AdminConexion();
    
    public Ingreso_Vehiculos() {
        initComponents();

        SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
        Date presente = new Date();

        this.tfecha.setText(dateFormat.format(presente));
        this.llenarClientes();

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        taño = new javax.swing.JFormattedTextField();
        cplaca = new javax.swing.JComboBox();
        tplaca = new javax.swing.JFormattedTextField();
        cmarca = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        ccolor = new javax.swing.JComboBox();
        tfecha = new javax.swing.JFormattedTextField();
        trecorrido = new javax.swing.JFormattedTextField();
        ctiporecorrido = new javax.swing.JComboBox();
        ctipovehiculo = new javax.swing.JComboBox();
        jLabel11 = new javax.swing.JLabel();
        clinea = new javax.swing.JComboBox();
        jPanel2 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        tplacaopc = new javax.swing.JTextField();
        tmarcaopc = new javax.swing.JTextField();
        tlineaopc = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        ttipoopc = new javax.swing.JTextField();
        tcoloropc = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel16 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel19 = new javax.swing.JLabel();
        ccliente = new javax.swing.JComboBox();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Ingreso de Vehículos");
        setResizable(false);

        jButton1.setText("Limpiar Formulario");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Ingresar Vehículo");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        try {
            taño.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        taño.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tañoActionPerformed(evt);
            }
        });

        cplaca.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "P", "C", "A", "O", "G" }));

        try {
            tplaca.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###???")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        tplaca.setText("");
        tplaca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tplacaActionPerformed(evt);
            }
        });

        cmarca.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Acura", "Alfa Romeo", "Audi", "BMW", "Cadillac", "Chevrolet", "Chrysler", "Daewoo", "Dodge", "Eagle", "Ferrari", "Ford", "Geo", "GMC", "Honda", "Hummer", "Hyundai", "Infiniti", "Isuzu", "Jeep", "Kia", "Land Rover", "Lexus", "Lincoln", "Mazda", "Mercedes-Benz", "Mercury", "Mini", "Mitsubishi", "Nissan", "Pontiac", "Scion", "Smart", "Subaru", "Suzuki", "Toyota", "Volkswagen", "Volvo" }));
        cmarca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmarcaActionPerformed(evt);
            }
        });

        jLabel2.setText("Línea:");

        jLabel3.setText("Marca");

        jLabel1.setText("Placa");

        jLabel6.setText("Color");

        jLabel4.setText("Año");

        jLabel5.setText("Tipo de Vehículo");

        jLabel9.setText("Sistema Métrico:");

        jLabel8.setText("Recorrido");

        jLabel7.setText("Fecha de Ingreso");

        ccolor.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Gris", "Rojo", "Negro", "Blanco", "Azul", "Verde", "Amarillo", " " }));

        tfecha.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter()));

        trecorrido.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
        trecorrido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                trecorridoActionPerformed(evt);
            }
        });

        ctiporecorrido.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "KMs", "MIs" }));

        ctipovehiculo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Sedán", "Coupé", "Hatchback", "PickUp", "Convertible", "SUV", "Camioneta", "MicroBus", " ", " ", " " }));

        jLabel11.setText("Formulario Principal");

        clinea.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "CL", "Integra", "NSX", "SLX", "RDX", "TL", "Legend", "MDX", "RL", "RSX", "TSX", "ZDX", " ", " " }));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6)
                            .addComponent(jLabel7)
                            .addComponent(jLabel8)
                            .addComponent(jLabel9)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel1)
                                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(28, 28, 28)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(tfecha)
                            .addComponent(ccolor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ctipovehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(cplaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(tplaca, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(taño, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ctiporecorrido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(trecorrido, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(clinea, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(cmarca, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(68, 68, 68)
                        .addComponent(jLabel11)))
                .addContainerGap(77, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(9, 9, 9)
                .addComponent(jLabel11)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(tplaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cplaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(cmarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(7, 7, 7)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(clinea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(taño, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(ctipovehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(ccolor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(tfecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(trecorrido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(ctiporecorrido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        jLabel12.setText("Datos Personalizados");

        jLabel13.setText("Placa");

        jLabel14.setText("Marca");

        jLabel15.setText("Línea:");

        jLabel17.setText("Tipo de Vehículo");

        jLabel18.setText("Color");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jLabel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel13))
                    .addComponent(jLabel17)
                    .addComponent(jLabel18))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(tplacaopc)
                    .addComponent(tmarcaopc)
                    .addComponent(tlineaopc)
                    .addComponent(ttipoopc, javax.swing.GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE)
                    .addComponent(tcoloropc))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(79, Short.MAX_VALUE)
                .addComponent(jLabel12)
                .addGap(69, 69, 69))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel12)
                .addGap(35, 35, 35)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tplacaopc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tmarcaopc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel15)
                    .addComponent(tlineaopc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(37, 37, 37)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(ttipoopc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(tcoloropc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(82, Short.MAX_VALUE))
        );

        jLabel10.setText("Formulario de Ingreso de Nuevos Vehículo");

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jLabel16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/media/Grupo TecProTeam SMALL.png"))); // NOI18N

        jLabel19.setText("Cliente:");

        jButton3.setText("Nuevo Cliente");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("Actualizar");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel19)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ccliente, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton4))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(ccliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3)
                    .addComponent(jButton4))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel10)
                        .addGap(163, 163, 163))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(28, 28, 28)
                                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addGap(85, 85, 85)
                .addComponent(jButton2)
                .addGap(158, 158, 158)
                .addComponent(jButton1)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jLabel16))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(24, 24, 24)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(54, 54, 54)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton2)
                    .addComponent(jButton1))
                .addGap(18, 18, 18)
                .addComponent(jLabel16)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        limpiarForm();        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        insertarVehiculo();        // TODO add your handling code here:
    }//GEN-LAST:event_jButton2ActionPerformed

    private void tañoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tañoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tañoActionPerformed

    private void trecorridoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_trecorridoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_trecorridoActionPerformed

    private void tplacaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tplacaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tplacaActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
         Ingreso_Clientes ic = new Ingreso_Clientes();
        ic.setVisible(true);          // TODO add your handling code here:
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        this.llenarClientes();        // TODO add your handling code here:
    }//GEN-LAST:event_jButton4ActionPerformed

    private void cmarcaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmarcaActionPerformed
        this.updateLinea();       // TODO add your handling code here:
    }//GEN-LAST:event_cmarcaActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Ingreso_Vehiculos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Ingreso_Vehiculos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Ingreso_Vehiculos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Ingreso_Vehiculos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Ingreso_Vehiculos().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox ccliente;
    private javax.swing.JComboBox ccolor;
    private javax.swing.JComboBox clinea;
    private javax.swing.JComboBox cmarca;
    private javax.swing.JComboBox cplaca;
    private javax.swing.JComboBox ctiporecorrido;
    private javax.swing.JComboBox ctipovehiculo;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JFormattedTextField taño;
    private javax.swing.JTextField tcoloropc;
    private javax.swing.JFormattedTextField tfecha;
    private javax.swing.JTextField tlineaopc;
    private javax.swing.JTextField tmarcaopc;
    private javax.swing.JFormattedTextField tplaca;
    javax.swing.JTextField tplacaopc;
    private javax.swing.JFormattedTextField trecorrido;
    private javax.swing.JTextField ttipoopc;
    // End of variables declaration//GEN-END:variables

    private void limpiarForm() {
        this.tplaca.setText("");
        this.taño.setText("");
        this.tfecha.setText("");
        
        this.trecorrido.setText("");

        this.clinea.setSelectedIndex(0);
        this.ccolor.setSelectedIndex(0);
        this.cmarca.setSelectedIndex(0);
        this.cplaca.setSelectedIndex(0);
        this.ctiporecorrido.setSelectedIndex(0);
        this.ctipovehiculo.setSelectedIndex(0);

        SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
        Date presente = new Date();
        this.tfecha.setText(dateFormat.format(presente));

    }

    private void insertarVehiculo() {

        String pla;
        String tpla = this.cplaca.getSelectedItem().toString().trim();
        String mar;
        String lin;
        int ani;
        String tip;
        String col;
        String fech;
        int reco;
        String treco;
        int cli;

        if (verificar()) {

            if (this.tplacaopc.getText().trim().equalsIgnoreCase("")) {
                pla = this.tplaca.getText().trim().toUpperCase();
            } else {
                pla = this.tplacaopc.getText().trim().toUpperCase();
            }

            if (this.tmarcaopc.getText().trim().equalsIgnoreCase("")) {
                mar = this.cmarca.getSelectedItem().toString().trim().toUpperCase();
            } else {
                mar = this.tmarcaopc.getText().toString().trim().toUpperCase();
            }

            if (this.tlineaopc.getText().trim().equalsIgnoreCase("")) {
                lin = this.clinea.getSelectedItem().toString().trim().toUpperCase();
            } else {
                lin = this.tlineaopc.getText().trim().toUpperCase();
            }

            ani = Integer.parseInt(this.taño.getText());

            if (this.ttipoopc.getText().trim().equalsIgnoreCase("")) {
                tip = this.ctipovehiculo.getSelectedItem().toString().toUpperCase();
            } else {
                tip = this.ttipoopc.getText().trim().toUpperCase().toUpperCase();
            }

            if (this.tcoloropc.getText().trim().equalsIgnoreCase("")) {
                col = this.ccolor.getSelectedItem().toString().toUpperCase();
            } else {
                col = this.tcoloropc.getText().toString().toUpperCase();
            }

            fech = this.tfecha.getText().toUpperCase();
            reco = Integer.parseInt(this.trecorrido.getText());
            treco = this.ctiporecorrido.getSelectedItem().toString().toUpperCase();
            
            String cliente = this.ccliente.getSelectedItem().toString().toUpperCase();
            String[] campos = cliente.split("-");        
            System.out.println("El id seleccionado es: "+ campos[0]);
            cli = Integer.parseInt(campos[0]);

            
            if (controld.InsertarAuto(tpla, pla.toUpperCase(), mar, lin, ani, tip, col, fech, reco, treco,cli)) {
                JOptionPane.showMessageDialog(this, "Vehículo agregado con éxito!!");
                this.limpiarForm();
            } else {
                JOptionPane.showMessageDialog(this, "Error al insertar, verifique los datos ingresados", "Error de Inserción", JOptionPane.ERROR_MESSAGE);
            }
            
        }
    }

    private boolean verificar() {
        boolean aprobado = true;



        System.out.println("p1 :" + this.tplaca.getText().trim().equalsIgnoreCase(""));
        System.out.println("p2 :" + this.tplacaopc.getText().equalsIgnoreCase(""));

        if (this.tplaca.getText().trim().equalsIgnoreCase("") && this.tplacaopc.getText().trim().equalsIgnoreCase("")) {
            aprobado = false;
            JOptionPane.showMessageDialog(this, "La PLACA ingresada no es válida o está en blanco!", "Error de entrada", JOptionPane.ERROR_MESSAGE);
        }

        

        if (this.taño.getText().trim().equalsIgnoreCase("")) {
            aprobado = false;
            JOptionPane.showMessageDialog(this, "El AÑO del vehículo ingresado es incorrecto o está en blanco!", "Error de entrada", JOptionPane.ERROR_MESSAGE);
        }

        if (this.tfecha.getText().trim().equalsIgnoreCase("")) {
            aprobado = false;
            JOptionPane.showMessageDialog(this, "La FECHA DE INGRESO es incorrecta o está en blanco!", "Error de entrada", JOptionPane.ERROR_MESSAGE);
        }

        if (this.trecorrido.getText().trim().equalsIgnoreCase("")) {
            aprobado = false;
            JOptionPane.showMessageDialog(this, "El RECORRIDO del vehículo está en blanco!", "Error de entrada", JOptionPane.ERROR_MESSAGE);
        
        }

        return aprobado;
    }
    
    
    private void llenarClientes() {
        
        
        this.ccliente.removeAllItems();
        try {
            
            
            aconect.abrirConexionBDD();
            ResultSet clientes = aconect.consulta("SELECT * FROM tecpro.cliente");
            while (clientes.next()) {
                String objeto = clientes.getObject("idcliente").toString() + "-" + clientes.getObject("nombre").toString() +"-"+ clientes.getObject("apellido").toString();
                this.ccliente.addItem(objeto); 
            }
            aconect.cerrarConexionBDD();
        } catch (Exception e) {
            System.out.println("Fallo llenar clientes: " + e);
        }

    }

    private void updateLinea() {
        
        String selected = this.cmarca.getSelectedItem().toString();
        
        if (selected.equalsIgnoreCase("acura")){
            this.clinea.setModel(new DefaultComboBoxModel(acura));
        } else if (selected.equalsIgnoreCase("Alfa Romeo"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(alfa));
        } else if (selected.equalsIgnoreCase("audi"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(audi));
        }
        else if (selected.equalsIgnoreCase("BMW"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(bmw));
        }else if (selected.equalsIgnoreCase("Cadillac"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(cadillac));
        }else if (selected.equalsIgnoreCase("Chevrolet"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(chevrolet));
        }else if (selected.equalsIgnoreCase("chrysler"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(chrysler));
        }else if (selected.equalsIgnoreCase("Land Rover"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(land_rover));
        } else if (selected.equalsIgnoreCase("Lexus"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(lexus));
        } else if (selected.equalsIgnoreCase("Lincoln"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(lincoln));
        } else if (selected.equalsIgnoreCase("Mazda"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(mazda));
        } else if (selected.equalsIgnoreCase("Mercedes-Benz"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(mercedes_benz));
        } else if (selected.equalsIgnoreCase("Mercury"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(mercury));
        }else if (selected.equalsIgnoreCase("Mini"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(mini));
        }else if (selected.equalsIgnoreCase("mitsubishi"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(mitsubishi));
        }else if (selected.equalsIgnoreCase("nissan"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(nissan));
        }else if (selected.equalsIgnoreCase("daewoo"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(daewoo));
        }else if (selected.equalsIgnoreCase("dodge"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(dodge));
        }else if (selected.equalsIgnoreCase("eagle"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(eagle));
        }else if (selected.equalsIgnoreCase("ferrari"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(ferrari));
        }else if (selected.equalsIgnoreCase("ford"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(ford));
        }else if (selected.equalsIgnoreCase("geo"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(geo));
        }else if (selected.equalsIgnoreCase("gmc"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(gmc));
        }else if (selected.equalsIgnoreCase("honda"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(honda));
        }else if (selected.equalsIgnoreCase("hyundai"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(hyundai));
        }else if (selected.equalsIgnoreCase("hummer"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(hummer));
        }else if (selected.equalsIgnoreCase("infiniti"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(infiniti));
        }else if (selected.equalsIgnoreCase("isuzu"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(isuzu));
        }else if (selected.equalsIgnoreCase("jeep"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(jeep));
        }else if (selected.equalsIgnoreCase("kia"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(kia));
        }else if (selected.equalsIgnoreCase("pontiac"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(pontiac));
        }else if (selected.equalsIgnoreCase("scion"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(scion));
        }else if (selected.equalsIgnoreCase("smart"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(smart));
        }else if (selected.equalsIgnoreCase("subaru"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(subaru));
        }else if (selected.equalsIgnoreCase("suzuki"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(suzuki));
        }else if (selected.equalsIgnoreCase("toyota"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(toyota));
        }else if (selected.equalsIgnoreCase("volkswagen"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(volkswagen));
        }else if (selected.equalsIgnoreCase("volvo"))
        {
            this.clinea.setModel(new DefaultComboBoxModel(volvo));
        }
        
        
    }
    
}
